home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20041116-20060924
/
000216_fdc@columbia.edu_Thu Dec 1 15:43:02 2005.msg
< prev
next >
Wrap
Internet Message Format
|
2006-09-27
|
2KB
Path: newsmaster.cc.columbia.edu!not-for-mail
From: Frank da Cruz <fdc@columbia.edu>
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Take command exiting...
Date: 1 Dec 2005 20:42:35 GMT
Organization: Columbia University
Lines: 35
Message-ID: <slrndouo1r.glb.fdc@sesame.cc.columbia.edu>
References: <1133384455.038767.79060@o13g2000cwo.googlegroups.com> <slrndos597.2sq.fdc@sesame.cc.columbia.edu> <1133386372.686029.66160@g47g2000cwa.googlegroups.com> <1133415677.052842.20950@f14g2000cwb.googlegroups.com> <1133468058.066993.41880@g14g2000cwa.googlegroups.com>
Reply-To: fdc@columbia.edu
NNTP-Posting-Host: sesame.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1133469755 22244 128.59.59.56 (1 Dec 2005 20:42:35 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 1 Dec 2005 20:42:35 GMT
User-Agent: slrn/0.9.8.0 (SunOS)
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15463
On 2005-12-01, malone <malonespam@cox.net> wrote:
: Ok I understand what you are saying. I will have to try that.
:
: another question:
: is there a way to monitor keyboard activity during a script?
:
: i know it monitors the ctrl-C but can i monitor other keys like 'A' or
: 'V' maybe using the \v(kbchar) or kbhit ?
:
Off the top of my head:
IF KBHIT <command>
SET INPUT CANCELLATION ON ; lets you interrupt INPUT from the keyboard
SET PAUSE CANCELLATION ON ; lets you interrupt PAUSE/SLEEP from the keyboard
Ctrl-C can be trapped by a macro called ON_CTRLC
Any command that times out, like PAUSE, SLEEP, or INPUT, can be interrupted by
a keystroke if the corresponding SET xxx CANCELATION is ON, and the character
that was typed is available in \v(kbhit). Let's see, what else...
Commands like ASK and GETC and GETOK can be told to time out. So, for
example, you can do something like this:
set ask-timer 10
getc \%c "Press any key within 10 seconds to quit:"
set ask-timer 0
echo
if asktimeout {
echo Continuing...
} else {
echo You typed: \%c
end
}
- Frank